package com.sojson.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.sojson.dao.CouponStoreDao;
import com.sojson.entity.po.CouponStore;
import com.sojson.service.CouponStoreService;

/**
 * 券可用店铺Service实现类
 * 
 * @author liu
 * @date 2021-06-02
 */
@Service
public class CouponStoreServiceImpl implements CouponStoreService {

    @Resource
    private CouponStoreDao couponStoreDaoImpl;

    /**
     * 单条插入
     * 
     * @param couponStore
     * @return
     */
    @Override
    public int insert(CouponStore couponStore) {
        int insert = couponStoreDaoImpl.insert(couponStore);
        return insert;
    }

    /**
     * 批量插入
     * 
     * @param couponStore
     * @return
     */
    @Override
    public int insertList(CouponStore couponStore) {
        int insertList = couponStoreDaoImpl.insertList(couponStore.getCouponStores());
        return insertList;
    }

    /**
     * 通过对象批量删除(物理删除)
     * 
     * @param couponStore
     * @return
     */
    @Override
    public int deleteByDto(CouponStore couponStore) {
        int deleteByDto = couponStoreDaoImpl.deleteByDto(couponStore);
        return deleteByDto;
    }

    /**
     * 统计全部数量
     * 
     * @return
     */
    @Override
    public int countAll() {
        int countAll = couponStoreDaoImpl.countAll();
        return countAll;
    }

    /**
     * 查询所有
     * 
     * @return
     */
    @Override
    public List<CouponStore> listAll() {
        List<CouponStore> findAll = couponStoreDaoImpl.listAll();
        return findAll;
    }

    /**
     * 根据对象统计数量
     * 
     * @param couponStore
     * @return
     */
    @Override
    public int countByDto(CouponStore couponStore) {
        int countByDto = couponStoreDaoImpl.countByDto(couponStore);
        return countByDto;
    }

    /**
     * 根据对象查询
     * 
     * @param couponStore
     * @return
     */
    @Override
    public List<CouponStore> listByDto(CouponStore couponStore) {
        List<CouponStore> findByDto = couponStoreDaoImpl.listByDto(couponStore);
        return findByDto;
    }

    /**
     * 通过id删除(物理删除)
     * 
     * @param id
     * @return
     */
    @Override
    public int deleteById(Integer id) {
        int deleteById = couponStoreDaoImpl.deleteById(id);
        return deleteById;
    }

    /**
     * 通过id数组删除(物理删除)
     * 
     * @param ids
     * @return
     */
    @Override
    public int deleteByIds(Integer[] ids) {
        int deleteByIds = couponStoreDaoImpl.deleteByIds(ids);
        return deleteByIds;
    }

    /**
     * 通过id更新(全部更新)
     * 
     * @param couponStore
     * @return
     */
    @Override
    public int updateAllById(CouponStore couponStore) {
        int updateAllById = couponStoreDaoImpl.updateAllById(couponStore);
        return updateAllById;
    }

    /**
     * 通过id列表更新(全部更新)(更新内容相同)
     * 
     * @param couponStore
     * @return
     */
    @Override
    public int updateAllByIdList(CouponStore couponStore) {
        int updateAllByIdList = couponStoreDaoImpl.updateAllByIdList(couponStore);
        return updateAllByIdList;
    }

    /**
     * 通过id列表更新(全部更新)(更新内容不相同)
     * 
     * @param couponStore
     * @return
     */
    @Override
    public int updateDtoListAllById(CouponStore couponStore) {
        int updateDtoListAllById = couponStoreDaoImpl.updateDtoListAllById(couponStore.getCouponStores());
        return updateDtoListAllById;
    }

    /**
     * 通过id更新(局部更新)
     * 
     * @param couponStore
     * @return
     */
    @Override
    public int updateById(CouponStore couponStore) {
        int updateById = couponStoreDaoImpl.updateById(couponStore);
        return updateById;
    }

    /**
     * 通过id列表更新(局部更新)(更新内容相同)
     * 
     * @param couponStore
     * @return
     */
    @Override
    public int updateByIdList(CouponStore couponStore) {
        int updateByIdList = couponStoreDaoImpl.updateByIdList(couponStore);
        return updateByIdList;
    }

    /**
     * 通过id列表更新(局部更新)(更新内容不相同)
     * 
     * @param couponStore
     * @return
     */
    @Override
    public int updateDtoListById(CouponStore couponStore) {
        int updateDtoListById = couponStoreDaoImpl.updateDtoListById(couponStore.getCouponStores());
        return updateDtoListById;
    }

    /**
     * 通过id查询
     * 
     * @param id
     * @return
     */
    @Override
    public CouponStore findById(Integer id) {
        CouponStore findById = couponStoreDaoImpl.findById(id);
        return findById;
    }

    /**
     * 通过id数组查询
     * 
     * @param ids
     * @return
     */
    @Override
    public List<CouponStore> findByIds(Integer[] ids) {
        List<CouponStore> findByIds = couponStoreDaoImpl.findByIds(ids);
        return findByIds;
    }

    /**
     * 通过对象查询id列表
     * 
     * @param couponStore
     * @return
     */
    @Override
    public List<Integer> findIdByDto(CouponStore couponStore) {
        List<Integer> findIdByDto = couponStoreDaoImpl.findIdByDto(couponStore);
        return findIdByDto;
    }

    /**
     * 清空数据(物理清空)
     */
    @Override
    public int clear() {
        return couponStoreDaoImpl.clear();
    }

    /**
     * 根据对象查询
     * 
     * @param couponStore
     * @return
     */
    @Override
    public List<CouponStore> list(CouponStore couponStore) {
        return couponStoreDaoImpl.list(couponStore);
    }

}